package book.security;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.security.CodeSigner;
import java.security.Timestamp;
import java.security.cert.CertPath;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.util.Date;

public class CodeSignerTest {

	public static void main(String[] args) throws CertificateException, FileNotFoundException {
		
		CertificateFactory factory = CertificateFactory.getInstance("X.509");
		CertPath path = factory.generateCertPath(new FileInputStream("/Users/apple/Documents/demo.cer"));
		Timestamp ts = new Timestamp(new Date(), path);
		CodeSigner cs = new CodeSigner(path, ts);
		System.out.println(cs.equals(new CodeSigner(path, ts)));
	}
}
